import request from '@/utils/request'

// 用户管理接口

// 获取用户列表
export const getUserList = (data) => {
  return request.get('/users', {
    params: data
  })
}

// 修改状态
export const modifyStatus = (id, bool) => {
  return request.put(`/users/${id}/state/${bool}`)
}

// 添加
export const addList = (data) => {
  return request.post('/users', data)
}

// 删除
export const delList = (id) => {
  return request.delete(`/users/${id}`)
}

// 获取用户个人信息
export const detailsUser = (id) => {
  return request(`/users/${id}`)
}

// 修改
export const modifyUser = (id, data) => {
  return request.put(`/users/${id}`, data)
}

// 获取角色
export const roleUser = () => {
  return request('/roles')
}

// 修改角色
export const updateRole = (id, params) => {
  return request.put(`/users/${id}/role`, params)
}
